<template>
  <div class="components-container">
    <!-- 新增修改 -->
    <sweet-modal ref="carinformation" class="dialog" :sweetModalMaxWidth="maxWidth">
      <h3>{{title}}</h3>
      <div>
        <fieldset class="layui-elem-field layui-field-title">
          <legend>
            <icon-svg icon-class="jbifm"/>派车信息一览表</legend>
        </fieldset>
        <div style="margin:10px 50px;">
          <el-table
    :data="dataList"
    height="250"

    style="width: 100%;margin:0 auto">
    <el-table-column v-for="(item,index) in headList" 
      :key=index
      :prop=item.ColumnKey
      :label=item.ColumnName
      align="center" 
      width="180">
    </el-table-column>
  </el-table>
       
          </div>
      </div>
    </sweet-modal>

  </div>
</template>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
</style>
<script>
import apiBase from "@/api/apiBase.js";
import dataTable from "@/components/Table/DataTable";
import sweetModal from "@/components/sweetModal";
import { manage } from "@/mixins/managePage.js";
import { formatDate, timeStringToDate } from "@/utils/date.js";
import { PRPORDER } from "@/const/orderConst.js";
import { ORDER } from "@/const/orderConst.js";
export default {
  mixins: [manage],
  data() {
    return {
      order: null,
      maxWidth: 900,
      headList: [],
      dataList: []
    };
  },
  methods: {
    open(order, id) {
      this.order = order;
      this.maxHeight = window.innerHeight - 240;
      //清理数据
      // this.prpData.PRPCALLDATE=new Date();
      switch (this.order) {
        case "派车信息":
          this.title = "派车信息一预览表";
          this.getColumns();
          this.getData();
          this.$refs.carinformation.open();
         
          break;
        default:
      }
    },

    
    //获取表头
    getColumns() {
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().Column.GetPCXXColumns,
        res => {
          this.headList = res.data.content;
        }
      );
    },
    //获取电话预约数据
    getData() {
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().Reserve.GetCDHInformation,
        res => {
          this.dataList = res.data.content;
        }
      );
    }
  },
  activated() {
    // this.getColumns();
    // this.getData();
  },

  components: {
    dataTable,
    sweetModal
  }
};
</script>

